//
//  DownLoadViewController.m
//  UI_A项目
//
//  Created by dlios on 15-1-20.
//  Copyright (c) 2015年 songCheng. All rights reserved.
//

#import "DownLoadViewController.h"
#import "DownLoadTableViewCell.h"
@interface DownLoadViewController ()

@end

@implementation DownLoadViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
  
    
 
    self.button1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 20, 125, 44)];
    
    [self.button1 setTitle:@"专辑" forState:UIControlStateNormal];
    
    [self.button1 setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    
    [self.button1 addTarget:self action:@selector(button1Action:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.navigationController.view addSubview:self.button1];
    
    
    
    self.button2 = [[UIButton alloc] initWithFrame:CGRectMake(125, 20, 125, 44)];
    
    [self.button2 setTitle:@"声音" forState:UIControlStateNormal];
    
    [self.button2 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    
    [self.button2 addTarget:self action:@selector(button2Action:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.navigationController.view addSubview:self.button2];
    
    
    
    self.button3 = [[UIButton alloc] initWithFrame:CGRectMake(250, 20, 125, 44)];
    
    [self.button3 setTitle:@"正在下载" forState:UIControlStateNormal];
    
    [self.button3 addTarget:self action:@selector(button3Action:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.button3 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    
    [self.navigationController.view addSubview:self.button3];
    
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(125, 27, 1, 30)];
    
    label.backgroundColor = [UIColor orangeColor];
    
    [self.navigationController.view addSubview:label];
    
    
    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(250, 27, 1, 30)];
    
    label1.backgroundColor = [UIColor orangeColor];
    
    [self.navigationController.view addSubview:label1];
    
    
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 375, 600)];
    
    self.tableView.backgroundColor = [UIColor redColor];
    
    self.tableView.delegate = self;
    
    self.tableView.dataSource = self;
    
    [self.view addSubview:self.tableView];
    
    
    
    // Do any additional setup after loading the view.
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{

    return 140;

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 15;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    static NSString *str = @"resource";
    
    DownLoadTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:str];
    
    if (cell == nil) {
        
        cell = [[DownLoadTableViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:str];
    }
    
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
//    cell.textLabel.text = @"qwqwq";
    
    return cell;


}

- (void)button1Action:(UIButton *)button
{
    [self.button1 setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    [self.button2 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    [self.button3 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    
}
- (void)button2Action:(UIButton *)button
{
    [self.button2 setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    [self.button1 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    [self.button3 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
}
- (void)button3Action:(UIButton *)button
{
    [self.button3 setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    [self.button1 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
    [self.button2 setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
